import http from '../../utils/http.js'


export function getChargingGroupList(type,name,pageCurrent,PageSize=10){
	return new Promise((resolve,reject)=>{
		var params={
		   url:'/v1/app/charging/group/list',
		   method:'GET',
		   data:{
			   chargingGroupType: type,
			   name: name,
			   current: pageCurrent,
			   size: PageSize
		   },
		   callBack:(res)=>{
			if(res.code==0){
			 resolve(res)
			}
			else{
			 reject(res.msg)
			}
		}
	  }
	  http.request(params)
	})
}

export function getChargingGroupDetail(id){
	return new Promise((resolve,reject)=>{
		var params={
		   url:'/v1/app/charging/group/detail',
		   method:'GET',
		   data:{
			   id: id
		   },
		   callBack:(res)=>{
			if(res.code==0){
			 resolve(res)
			}
			else{
			 reject(res.msg)
			}
		}
	  }
	  http.request(params)
	})
}

export function getCarChargingGroupDetail(id){
	return new Promise((resolve,reject)=>{
		var params={
		   url:'/v1/app/charging/group/car/detail',
		   method:'GET',
		   data:{
			   id: id
		   },
		   callBack:(res)=>{
			if(res.code==0){
			 resolve(res)
			}
			else{
			 reject(res.msg)
			}
		}
	  }
	  http.request(params)
	})
}